package com.xcx.eduservice.client;


import com.xcx.commonuntils.returnuntls.ReturnMessage;
import com.xcx.eduservice.entity.feignentity.FileSystem;
import com.xcx.eduservice.request.feignrequest.GetUserFilesRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Component
@FeignClient(name = "minio-service",fallback = MinioFileDegradeFeignClient.class)
public interface MinioFengClient {

    @PostMapping(value = "/fileSystem/minio/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    //@RequestMapping(value = "/area/queryAll", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    ReturnMessage<Object> upload(@RequestPart("file") MultipartFile file);

    @PostMapping(value = "/fileSystem/minio/getUserFiles")
    ReturnMessage<List<FileSystem>> getUserFiles(@RequestBody GetUserFilesRequest request);


}
